package com.zx.Servlet;

import com.zx.Service.AdminService;
import com.zx.Service.AminServiceImpl;
import com.zx.Service.UserService;
import com.zx.Service.UserServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;

/**
 * com.zx.Servlet
 * 26832
 * zx
 * &#064;description: 处理数据
 * &#064;author: lxm
 * PassData
 * &#064;create: 2024-06-22 17:03
 **/
@WebServlet("/passdata")
public class PassData extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        resp.setCharacterEncoding("utf-8");
        //获取前端的idcard和vaccine
        String idcard = req.getParameter("idcard");
        String vaccine = req.getParameter("vaccine");
        System.out.println(idcard+vaccine);
        AdminService adminService = new AminServiceImpl();
        try {
            adminService.PassDate(idcard,vaccine);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
}
